package blogger.client.async.services;

import java.util.List;
import java.util.Date;


import blogger.client.async.GetTwitsResponse;
import blogger.client.model.entity.Message;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.core.client.GWT;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("TwitService")
public interface TwitService extends RemoteService {
    public GetTwitsResponse lastTwits(Date time);

    public Message twitMessage(Message msg);

    public void deleteTwit(long id);

    public GetTwitsResponse getTwits();

    public static class App {
        private static final TwitServiceAsync ourInstance;

        static {
            ourInstance = (TwitServiceAsync) GWT.create(TwitService.class);
            ((ServiceDefTarget) ourInstance).setServiceEntryPoint(GWT.getModuleBaseURL() + "TwitService");
        }

        public static TwitServiceAsync getInstance() {
            return ourInstance;
        }
    }

}
